package messages;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;

public class DiscussionMessage implements Serializable, Message{
	

	/**
	 * 
	 */
	private static final long serialVersionUID = -2668034280404777931L;
	private String user;
	private String avatar;
	private String message;
	private String time;
	private int messageLength;
	
	private String chatRoom;
	
	DateFormat dateFormat;
	Calendar cal;
	
	public DiscussionMessage(String user, String avatar, String message, int messageLength, String chatRoom){
		dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
		cal = Calendar.getInstance();
		
		this.user = user;
		this.avatar = avatar;
		this.message = message;
		this.time = (dateFormat.format(cal.getTime()))+"";
		this.messageLength = messageLength;
		this.chatRoom = chatRoom;
	}


	public String getUser() {
		return user;
	}
	
	public String getAvatar() {
		return avatar;
	}

	public String getTime(){
		return time;
	}

	public String getMsg() {
		return message;
	}
	
	public int getMsgLength(){
		return this.messageLength;
	}
	
	public String getType() {
		System.out.println(Message.discussionKey);
		return Message.discussionKey;
	}
	
	public String getChatRoom(){
		return chatRoom;
	}


}
